package LineCode.网易经典.test3;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        long[] result = new long[n];
        long[][] jisuan = new long[n][k];
        long[] kres = getResNums(k);

        for (int i = 0; i < k; i++) {

            jisuan[0][i] = i+1;
        }
        for (int i = 1; i < result.length; i++) {
            for (int j = 0; j < jisuan[i].length; j++) {
                long s = jisuan[i-1][j];
                jisuan[i][j] = kres[new Long(s).intValue()];
            }
        }
        for (int i = 0; i < result.length; i++) {
                long s = 0;
            for (int j = 0; j < jisuan[i].length; j++) {
                s +=jisuan[i][j];
            }
            result[i] = s;
        }
        System.out.println(result[n-1]);

    }

    public static long[] getResNums(int k) {
        long[] res = new long[k];
        res[0] = k;
        for (int i = 1; i < k; i++) {
            res[i] = k-i +getDeNum(i+1);
        }
        return res;
    }

    public static long getDeNum(int k) {
        long res = 0;
        for (int i = 2; i < k; i++) {
            if (k % i != 0)
                res++;

        }
        return res;
    }
}